package cn.net.yugu.doraemon.sharding.annotation;

import cn.net.yugu.doraemon.sharding.consntant.DateFormat;
import cn.net.yugu.doraemon.sharding.strategy.ITableShardStrategy;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author wanghongli
 * @date 2023/12/16 14:06
 * @description TableShard
 **/
@Target(value = {ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface TableShard {
    String tableNamePrefix();
    String shardKey() default "";
    int tableSize() default 1;
    String dateShardFormat() default DateFormat.YYYYMM;
    boolean fieldFlag() default false;
    Class<? extends ITableShardStrategy> shardStrategy();
}
